package com.example.zhidao.model.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;

@Data
@Component
public class Blog {
    private String id;
    private String title;
    private String content;
    private int collection;
    private int view;
    private int good;
    @DateTimeFormat(pattern = "yyyy-dd HH:mm:ss") // 从前端接收数据时，需要进行的转换
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") // 返回到前端时，需要进行的转换
    private Date createtime;
    @DateTimeFormat(pattern = "yyyy-dd HH:mm:ss") // 从前端接收数据时，需要进行的转换
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") // 返回到前端时，需要进行的转换
    private Date updatetime;
    private int type;
    private String img;
    private String uid;
    private String audit;
    private int comm;
    private int cid;//文章分类

//    设置数据库之外的字段
    @TableField(exist = false)
    private String username;
    @TableField(exist = false)
    private String uimg;
    @TableField(exist = false)
    private String cname;

}
